package com.ghw.neteasemusic.common.configuration;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 静态资源映射
 *
 * @author violet
 * @since 2021/12/9 22:18
 */
@Configuration
public class StaticResourceMapping implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/resource/**")
                .addResourceLocations("file:D:\\Games\\BGM\\");
        registry.addResourceHandler("/photo/**")
                .addResourceLocations("file:G:\\picture\\");
    }
}
